# 读取JSON文件
#需要1682个item 爬取了1699 所以要去除17个  不过其实去不去除都行 多一点不会如何 最后没去除
import json
typeRT=['智能先锋', '时尚达人','居家优品' ,'超市百货' ,'进口好物']
num=0
preNum=0
for typei in range(5):
    for x in range(10):
        with open(f'../storeJsonData/JD{typeRT[typei]}{x+1}.json', 'r', encoding='UTF-8') as f:
            data = json.load(f)
            if len(data)==24:
                print(x+1)
            num = num + len(data)
    if num - preNum !=250:
        print(typeRT[typei])
    preNum=num


for x in range(10,20):
    with open(f'../storeJsonData/JD{typeRT[0]}{x+1}.json', 'r', encoding='UTF-8') as f:
        data = json.load(f)
        num = num + len(data)
for x in range(10,18):
    with open(f'../storeJsonData/JD{typeRT[1]}{x+1}.json', 'r', encoding='UTF-8') as f:
        data = json.load(f)
        num = num + len(data)
# 打印转换后的字典
print(num)